ScOptionsGlsl

Options for the GLSL compiler

Members

Variables

enable420PackExtension
bool enable420PackExtension;

For older desktop GLSL targets than version 420, the GL_ARB_shading_language_420pack extensions is used to be able to support layout(binding) on UBOs and samplers. If disabled on older targets, binding decorations will be stripped.

es
bool es;

Emit the OpenGL ES shading language instead of desktop OpenGL.

flattenMultidimensionalArrays
bool flattenMultidimensionalArrays;

Flattens multidimensional arrays, e.g. float fooabc into single-dimensional arrays, e.g. float foo[a * b * c]. This function does not change the actual SPIRType of any object. Only the generated code, including declarations of interface variables are changed to be single array dimension.

forceTemporary
bool forceTemporary;

Debug option to always emit temporary variables for all expressions.

fragDefaultFloatPrecision
GlslPrecision fragDefaultFloatPrecision;

Add precision mediump float in ES targets when emitting GLES source.

fragDefaultIntPrecision
GlslPrecision fragDefaultIntPrecision;

Add precision highp int in ES targets when emitting GLES source.

separateShaderObjects
bool separateShaderObjects;

If true, gl_PerVertex is explicitly redeclared in vertex, geometry and tessellation shaders. The members of gl_PerVertex is determined by which built-ins are declared by the shader. This option is ignored in ES versions, as redeclaration in ES is not required, and it depends on a different extension (EXT_shader_io_blocks) which makes things a bit more fuzzy.

ver
uint ver;

The shading language version. Corresponds to #version $VALUE.

vertFixupClipspace
bool vertFixupClipspace;

GLSL: In vertex shaders, rewrite [0, w] depth (Vulkan/D3D style) to [-w, w] depth (GL style).

vertFlipY
bool vertFlipY;

Inverts gl_Position.y or equivalent.

vertSupportNonzeroBaseInstance
bool vertSupportNonzeroBaseInstance;

If true, the backend will assume that InstanceIndex will need to apply a base instance offset. Set to false if you know you will never use base instance functionality as it might remove some internal uniforms.

vulkanSemantics
bool vulkanSemantics;

If true, Vulkan GLSL features are used instead of GL-compatible features. Mostly useful for debugging SPIR-V files.

Meta